import request from '@/utils/request'

// 查询约课-讲师列表
export function listLecturer(query) {
	return request({
		url: '/course/lecturer/list',
		method: 'get',
		params: query
	})
}

// 查询约课-讲师详细
export function getLecturer(id) {
	return request({
		url: '/course/lecturer/' + id,
		method: 'get'
	})
}

// 新增约课-讲师
export function addLecturer(data) {
	return request({
		url: '/course/lecturer',
		method: 'post',
		data: data
	})
}

// 修改约课-讲师
export function updateLecturer(data) {
	return request({
		url: '/course/lecturer',
		method: 'put',
		data: data
	})
}

// 删除约课-讲师
export function delLecturer(id) {
	return request({
		url: '/course/lecturer/' + id,
		method: 'delete'
	})
}

/**
 * 约课报表
 * @param {Object} month
 */
export function selectLedger(month) {
	return request({
		url: `/course/lecturer/selectLedger?month=${month}`,
		method: 'get'
	})
}

/**
 * 课时统计
 * @param {Object} startTime
 */
export function selectClassHour(startTime, endTime) {
	return request({
		url: `/course/lecturer/selectClassHour?startTime=${startTime}&endTime=${endTime}`,
		method: 'get'
	})
}

/**
 * 讲师-地区课时分布统计
 * @param {Object} startTime
 */
export function selectDealerForms(startTime, endTime) {
	return request({
		url: `/course/lecturer/selectDealerForms?startTime=${startTime}&endTime=${endTime}`,
		method: 'get'
	})
}

/**
 * 月份-地区课时分布统计
 * @param {Object} startTime
 */
export function selectDealerMonthForms(startTime, endTime) {
	return request({
		url: `/course/lecturer/selectDealerMonthForms?startTime=${startTime}&endTime=${endTime}`,
		method: 'get'
	})
}

/**
 * 月份-地区
 * @param {Object} startTime
 * @param {Object} endTime
 */
export function statistics(startTime, endTime) {
	return request({
		url: `/course/dealer/statistics?startTime=${startTime}&endTime=${endTime}`,
		method: 'get'
	})
}